# core/base_engine.py
from abc import ABC, abstractmethod
from typing import Dict, List, Optional
from datetime import datetime


class TranslationEngine(ABC):
    """翻译引擎抽象基类"""

    @abstractmethod
    def translate(
        self,
        text: str,
        source_lang: str = "auto",
        target_lang: str = "en"
    ) -> Dict[str, str]:
        """
        翻译单个文本
        :return: 包含 source_text, translated_text, source_lang, target_lang, engine, timestamp 的字典
        """
        pass

    @abstractmethod
    def batch_translate(self, texts: List[str], target_lang: str) -> List[str]:
        """批量翻译"""
        pass

    @abstractmethod
    def supported_languages(self) -> List[str]:
        """支持的语言列表"""
        pass

    @abstractmethod
    def is_ready(self) -> bool:
        """引擎是否已就绪"""
        pass